home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2003 December / The Sunday Times - The Month 2003-12.iso / mac / The Month DEC 03 / engine / modules / lists.swf / scripts / frame_1 / DoAction.as
Text File  |  2003-08-19  |  2KB  |  57 lines

  1. function loadImage(mc, node, extrapath)
  2. {
  3.    extrapath != null ? 0 : (extrapath = "");
  4.    var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
  5.    var strImg = node.getText();
  6.    var diffpath = node.attributes.path;
  7.    if(diffpath != null)
  8.    {
  9.       strImg = diffpath + strImg;
  10.    }
  11.    else
  12.    {
  13.       strImg = strDefaultPath + extrapath + strImg;
  14.    }
  15.    strPathPrefix != null ? 0 : (strPathPrefix = "");
  16.    mc.loadMovie(strPathPrefix + strImg);
  17. }
  18. function init()
  19. {
  20.    var strID = Tardis.ActiveSection.id;
  21.    var Colors = Tardis.Colors;
  22.    strSECTION_COLOR = Colors.getString(strID);
  23.    SECTION_COLOR = Colors.getHex(strID);
  24.    SECTION_COLOR50 = Colors.getString(strID + "50");
  25.    DEFAULT_COLOR = Colors.getString("default");
  26.    DEFAULT_COLOR50 = Colors.getString("default50");
  27.    ndItems = nodeData.byName("items");
  28.    ndListing = nodeData.byName("listing");
  29.    var strTitle = "<FONT COLOR=\"" + strSECTION_COLOR + "\">" + ndListing.byName("title").getText() + " </FONT>";
  30.    strTitle += "<FONT COLOR=\"" + SECTION_COLOR50 + "\"> " + ndListing.byName("title2").getText() + "</FONT>";
  31.    strTitle += "<FONT COLOR=\"" + DEFAULT_COLOR50 + "\"> " + ndListing.byName("title3").getText() + "</FONT>";
  32.    listingTitleFF.htmlText = strTitle;
  33.    listingTitleFF.resize();
  34.    if(listingTitleFF._height > 40)
  35.    {
  36.       attachMovie("items2MC","itemMC",++depth);
  37.       itemMC._x = 8;
  38.       itemMC._y = 61;
  39.    }
  40.    else
  41.    {
  42.       attachMovie("items1MC","itemMC",++depth);
  43.       itemMC._x = 8;
  44.       itemMC._y = 38;
  45.    }
  46.    onComplete();
  47. }
  48. function exit()
  49. {
  50.    delete ndItems;
  51.    delete ndDefault;
  52.    delete nodeData;
  53. }
  54. stop();
  55. onReady();
  56. depth = 0;
  57.